﻿Imports System.Web
Imports System.Net
Imports System.Text
Imports System.IO

Public Class Form1

    Private _sessionID As String = "3y3nqp55orf4x155ne15ygjk"

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPost.Click
        Dim m As New Mylot(txtSEssionID.Text)
        If rdbComment.Checked Then
            m.PostComment(txtQuestionID.Text, txtAnswerID.Text, txtResponse.Text)
        ElseIf rdbResponse.Checked Then
            m.PostResponse(txtQuestionID.Text, txtResponse.Text)
        Else
            MsgBox("Please select an option")
        End If
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        CheckRDB()
    End Sub

    Private Sub CheckRDB()
        If Not rdbComment.Checked AndAlso rdbResponse.Checked Then
            rdbResponse.Checked = True
        End If

        txtAnswerID.Visible = rdbComment.Checked

    End Sub

    Private Sub rdbComment_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rdbComment.CheckedChanged, rdbResponse.CheckedChanged
        CheckRDB()
    End Sub

End Class